<?php
include("header.php");
$width = 322;
$height = 322;
$pixel = 1;
?>
<center><canvas id="canvas" width="<?php echo $width * $pixel; ?>" height="<?php echo $height * $pixel; ?>"></canvas></center>
<center><div id="error"></div></center>
<script language="javascript" type="text/javascript">

VisualsStop();

bgcolor=0x0;
width = <?php echo $width; ?>;
height = <?php echo $height; ?>;
pixel = <?php echo $pixel; ?>;
needs_init = true;
line_blend_mode = 2;
redraw = false;

// INIT
drawMode = 0;
clearFrame = true;
n=width*10;
var zs=Math.sqrt(2); 
var izs=5.893/2; 
var iys=3.385/2;
var zt = 50; 
var yt = 25; 
var xt = 1;
var izt = 0.01;
var iyt = 0.01;
var ixt = 0.01;

function init() { n = 500; }

var rx1=0; 
var ry1=0; 
var rz1=0; 
var rx2=0; 
var ry2=0; 
var t1 = 0;

function frame() { 
	zt=zt+izt;
	yt=yt+iyt;
	xt=xt+ixt;
	cz=Math.cos(zt); sz=Math.sin(zt); cy=Math.cos(yt); sy=Math.sin(yt); cx=Math.cos(xt); sx=Math.sin(xt);
	red = 15/ 255;green = 63 / 255;blue = 31 / 255;xt = xt + .09;
}

function beat() {
	//return;
	//izt= Math.random()
	//iyt= iyt * v;
	//ixt= v * 100;

}

function point() {
	var random = Math.random() * 100;
	t1=if2(equal(random,0),0,t1);
	t1=if2(below(random,86)*above(random,0),1,t1);
	t1=if2(below(random,93)*above(random,86),2,t1);
	t1=if2(below(random,99)*above(random,92),3,t1);
	rx2=rx1;
	ry2=ry1;
	rx1=if2(equal(t1,0),0,rx1);
	ry1=if2(equal(t1,0),ry1*0.18,ry1);
	rz1=if2(equal(t1,0),0,rz1);
	rx2=rx1;
	ry2=ry1;
	rx1=if2(equal(t1,1),rx1*0.85,rx1);
	ry1=if2(equal(t1,1),ry1*0.85+rz1*0.1+1.6,ry1);
	rz1=if2(equal(t1,1),ry2*-0.1+rz1*0.85,rz1);
	rx2=rx1; ry2=ry1;
	rx1=if2(equal(t1,2),rx1*0.2+ry1*-0.2,rx1);
	ry1=if2(equal(t1,2),rx2*0.2+ry1*0.2+0.8,ry1);
	rz1=if2(equal(t1,2),rz1*0.3,rz1);
	rx2=rx1; ry2=ry1;
	rx1=if2(equal(t1,3),rx1*-0.2+ry1*0.2,rx1);
	ry1=if2(equal(t1,3),rx2*0.2+ry1*0.2+0.8,ry1);
	rz1=if2(equal(t1,3),rz1*0.3,rz1);
	x1=rx1; y1=ry1; z1=rz1;
	x2=x1*cz+y1*sz; y2=x1*sz-y1*cz;
	x3=x2*cy+z1*sy; z2=x2*sy-z1*cy;
	y3=y2*cx+z2*sx; z3=y2*sx-z2*cx+10;
	x=x3/z3; y=y3/z3;
	x = x / 1.5; y = y / 1.5;
}

var scope = new r_sscope("Fearn Leaf", init, frame, beat, point);

AddLink(scope);

VisualsStart(); 
</script>
<?php include("footer.php"); ?>
